# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
# Contributor: Joel Teichroeb <joel@teichroeb.net>
# Contributor: Jonas Heinrich <onny@project-insanity.org>

pkgname=double-conversion
pkgver=3.1.1
pkgrel=1
pkgdesc='Binary-decimal and decimal-binary routines for IEEE doubles'
arch=(x86_64)
url='https://github.com/google/double-conversion'
license=(BSD)
depends=(gcc-libs)
makedepends=(cmake)
source=(double-conversion-$pkgver.tar.gz::https://github.com/google/double-conversion/archive/v$pkgver.tar.gz)
sha256sums=('c49a6b3fa9c917f827b156c8e0799ece88ae50440487a99fc2f284cfd357a5b9')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DBUILD_SHARED_LIBS=ON
  make
}

package () {
  cd build
  make DESTDIR="$pkgdir" install

  install -Dm644 "$srcdir"/$pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/double-conversion
}
